The present invention relates to online exchange modules in an operating system (OS) which supports a logical space, and, more specifically, to a memory management module.
In industrial fields or embedded systems, the function of online partial exchange of an OS is important. If online exchange is possible, the down time of the system can be reduced. For example, the system need not be stopped in order to upgrade the OS or fix bugs thereof.
In addition, the memory capacity of the OS can be reduced. For example, a trace function will be considered below. Normally, an OS having no trace function is made to operate. If a trouble occurs, the OS is partially replaced with a trace function support version to trace its operation. In this manner, it is possible to minimize the memory capacity required for tracing.
A method of updating a running program by altering or adding a module to the program is described in Japanese Patent Laid-Open No. 319683/1995.
In this method, while a control section is executing an old load module, a relocatable type of new load module is stored in a main storage and an address linkage is established between the new load module and the old load module. During program updating, a call to the old load module from another module is inhibited, and the leading address of the old load module is rewritten with a jump-to-new load module instruction and the call inhibition is canceled. During a return from the program updating, the call to the old load module from another load module is inhibited, and the leading address of the old load module is rewritten with contents which were present before the program updating, and the call inhibition is canceled.
Presently, even a small OS such as an embedded system have had memory control which supports a logical space. The use of a logical space makes it possible to solve the problem of external fragmentation and increase the efficiency of use of memory. It is also possible to strengthen memory protection To this end, the memory control is realized as one module called memory management module.
However, the prior art shown in FIG. 2 has the problem that even if the memory control is realized as a module, the module cannot be exchanged online. The reason for this is as follows. The memory management module has a page table to record the correspondence between logical addresses and physical addresses. However, at the moment when an old module 142 is newly switched to a new module 143, the internal data of the new module 143 is in an initialized state. A page table for the new module 143 is not yet created. Accordingly, the new module 143 is not able to refer to the internal data of the old module 142 on the logical space, and loses the whole of the current mapping information. Accordingly, the OS becomes unable to continue a normal operation.
Because of the above-described problems, the conventional OS does not support the exchange of the memory management module. However, the memory capacity of the memory management module occupies a large proportion. If the online exchange of the memory management module is realized, it is possible to effectively reduce the down time of the OS.
In view of the above-described problems, an object of the prevent invention is to provide a module exchanging method and apparatus both of which make it possible to inherit data from an old load module to a new load module and online replace the old load module with the new load module.
The above object can be achieved by a method of exchanging modules in an operating system which includes a plurality of modules, a framework, an inheritance buffer which holds logical addresses and physical addresses for each module, and an inheritance buffer and includes a fixed physical space whose logical space and physical space are equal to each other and a virtual space whose logical space and physical space do not coincide with each other, wherein the operating system has a page table which manages a correspondence between logical addresses and physical addresses for each module and a memory management table which manages the page table, and wherein the correspondence between the logical addresses and the physical addresses is stored in the inheritance buffer from the page table of an old memory management module before an exchange, and a new memory management module after the exchange reads the correspondence between the logical addresses and the physical addresses from the inheritance buffer and creates the page table of the new memory management module.